<?php


namespace api\blog\controller;


use api\blog\model\ClassifyModel;
use cmf\controller\RestBaseController;

class ClassifyController extends RestBaseController
{
    //查询内容，搜索名称
    public function getClassifyList(){
        //分页
        $page = input('page/d',1);
        $pageSize = input('page_size/d',10);
        $title = input('title');
        $where = [];
        if($title){
            $where[] = ['title' , 'like','%'.$title.'%'];
        }
        $list = ClassifyModel::order('id','desc')
            ->field('id,image,title')
            ->where($where)
            ->page($page,$pageSize)
            ->select();
        $this->success('分类列表',$list);
    }
}